package com.yxw.live_vod_boot.log;

import com.yxw.live_vod_boot.service.LogService;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 系统消息发送日志记录
 * liuxin
 * 2023.11.21
 */
@Aspect
@Component
@Slf4j
public class SendNoticeLogAspect {

    @Autowired
    private LogService logService;
    /**
     * 切入方法出口路径
     */
    @Pointcut(value = "execution(* com.yxw.live_vod_boot.service.impl.SysNoticeServiceImpl.sendNotice(..))")
    public void exportPointcut() {

    }

    //进入切入方法后执行
    @AfterReturning(returning  = "result",pointcut = "exportPointcut()")
    public void AfterReturning(JoinPoint joinPoint,Object result) {
        logService.addSysNoticeLog(result);
    }
}